import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysToolTables = (params) => {
  params.head.transCode = 'querySysToolTables';
  return request({
    url: '/tool/sysToolTables/querySysToolTables',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysToolTablesListPage = (params) => {
  params.head.transCode = 'querySysToolTablesListPage';
  return request({
    url: '/tool/sysToolTables/querySysToolTablesListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysToolTables = (params) => {
  params.head.transCode = 'saveSysToolTables';
  return request({
    url: '/tool/sysToolTables/saveSysToolTables',
    method: 'post',
    data: params
  })
}
//修改单条记录
export const updateSysToolTables = (params) => {
  params.head.transCode = 'updateSysToolTables';
  return request({
    url: '/tool/sysToolTables/updateSysToolTables',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysToolTables = (params) => {
  params.head.transCode = 'deleteSysToolTables';
  return request({
    url: '/tool/sysToolTables/deleteSysToolTables',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysToolTablesList = (params) => {
  params.head.transCode = 'deleteSysToolTablesList';
  return request({
    url: '/tool/sysToolTables/deleteSysToolTablesList',
    method: 'post',
    data: params
  })
}
//生成代码
export const generatorCode = (params) => {
  params.head.transCode = 'generatorCode';
  return request({
    url: '/tool/sysToolTables/generatorCode',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysToolTablesExcel = (params) => {
  downloadExcel({
    url: '/tool/sysToolTables/excelDownload/exportSysToolTablesExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
